package com.franklin.ideaplugin.api.ui.editor;

import com.franklin.ideaplugin.api.ui.ToolBarWindowForm;
import com.franklin.ideaplugin.api.utils.SwingUtils;
import com.intellij.ide.highlighter.JavaFileType;
import com.intellij.ui.components.JBScrollPane;
import lombok.Getter;

import javax.swing.*;
import java.awt.*;

/**
 * @author Ye Junhui
 * @since 2023/7/6
 */
@Getter
public class FormatCustomJsonEditor extends ToolBarWindowForm implements
        IBaseFormatJsonEditor,
        IBaseZoomInEditor ,
        IBaseSoftWrapEditor,
        IBaseResetEditor
{
    private final JButton formatButton = new JButton();
    private final JButton zoomInButton = new JButton();;
    private final JButton softWrapButton = new JButton();;
    private final JButton resetButton = new JButton();;

    private final String title;
    private final CustomEditor editor;

    public FormatCustomJsonEditor(String title, CustomEditor editor) {
        this.title = title;
        this.editor = editor;

        this.initFormatButton(this.editor,this.formatButton);
        this.initZoomInButton(this.editor,this.zoomInButton,this.title);
        this.initSoftWrapButton(this.editor,this.softWrapButton);
        this.initRestButton(this.editor,this.resetButton);

        this.addToolButton(this.formatButton);
        this.addToolButton(this.zoomInButton);
        this.addToolButton(this.softWrapButton);
        this.addToolButton(this.resetButton);

        this.addContent(this.editor,new Dimension(-1,-1));
    }

}
